package cn.jervain.nut.auth.core.token;


import com.fasterxml.jackson.annotation.JsonIgnore;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public interface Token<T> {

    @JsonIgnore
    default Integer getGrantedIdentity() {
        return null;
    }

    @JsonIgnore
    default List<String> getGrantedRoles() {
        return new ArrayList<>();
    }

    @JsonIgnore
    default List<String> getGrantedAccesses() {
        return new ArrayList<>();
    }

    @JsonIgnore
    default T getGrantedDetail() {
        return null;
    }

    @JsonIgnore
    default LocalDateTime getGrantedExpireAt() {
        return LocalDateTime.now();
    }

    @JsonIgnore
    default boolean isAccountLocked() {
        return false;
    }

}
